<template>
	<u-popup v-model="vuex_qr" mode="bottom" border-radius="20" @open="init" @close="cancel">
		<qr-img ref="cash" :msg="msg" @cannel="cancel"></qr-img>
	</u-popup>
</template>

<script>
	import qrImg from "@/components/qr-popup/qr-img";	//充值
	export default {
		components: {
			qrImg,
		},
		props: {
			msg: {
				// 动态数据
				type: String,
				required: false,
				default: function() {
					return '关注服务号可红包提现';
				}
			},
		},
		data() {
			return {
				login: {
					appId: '',
					encryptedData: '',
					code: '',
					iv: ''
				},
			}
		},
		computed: {
			vuex_qr: {
			    get() {
			      return this.$store.state.vuex_qr;
			    },
			    set(value) {
				  this.$store.commit('setQr', value);
			    }
			},
		},
		methods: {
			init() {
				
			},
			getAmount() {
				this.$u.get('/pay/coinCash/getCash').then(res => {
					this.$store.commit('setCashAmount', res.data);
					this.$refs.cash.init();
				});
			},
			ok() {
				this.getAmount();
			},
			cancel() {
				this.$store.commit('setQr', false);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.tip-info {
		font-size: 30rpx;
		display: flex;
		justify-content: center;
		color: #303133;
		margin-bottom: 15px;
	}
	.page {
		padding: 30px 15px;
	}
	.avatar-box {
		display: flex;
		justify-content: center;
		padding: 15px;
		padding-top: 0;
	}
</style>
